package org.wiw.client.gui;

import org.wiw.client.model.Place;

import com.google.gwt.user.client.ui.RichTextArea;
import com.google.gwt.user.client.ui.TextBox;

public class AddMarkerDialog extends AbstractOkCancelDialog {

	private TextBox when;
	private RichTextArea description;

	public AddMarkerDialog() {
		super("Add Place");
		when = new TextBox();
		description = new RichTextArea();
	}
	public AddMarkerDialog(Place place) {
		this();
		this.when.setText(place.getWhen());
		this.description.setHTML(place.getDescription());
	}
	
	@Override
	protected void createContent() {
		add("When", when);
		when.setWidth("40em");
		
		add("Description", description);
		description.setWidth("40em");
		description.setHeight("8em");
	}
	
	public String getWhen() {
		return when.getText();
	}
	
	public String getDescription() {
		return description.getHTML();
	}
}
